#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {
    int a, b, c, count = 0;
    scanf("%d%d", &a, &b);
    c = a ^ b;
    while (c)
    {
        c = c & (c - 1);
        count++;
    }
    printf("%d\n", count);
    return 0;
}